.\"
.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
.\" permission to reproduce portions of its copyrighted documentation.
.\" Original documentation from The Open Group can be obtained online at
.\" http://www.opengroup.org/bookstore/.
.\"
.\" The Institute of Electrical and Electronics Engineers and The Open
.\" Group, have given us permission to reprint portions of their
.\" documentation.
.\"
.\" In the following statement, the phrase ``this text'' refers to portions
.\" of the system documentation.
.\"
.\" Portions of this text are reprinted and reproduced in electronic form
.\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
.\" Standard for Information Technology -- Portable Operating System
.\" Interface (POSIX), The Open Group Base Specifications Issue 6,
.\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
.\" Engineers, Inc and The Open Group.  In the event of any discrepancy
.\" between these versions and the original IEEE and The Open Group
.\" Standard, the original IEEE and The Open Group Standard is the referee
.\" document.  The original Standard can be obtained online at
.\" http://www.opengroup.org/unix/online.html.
.\"
.\" This notice shall appear on any product containing this material.
.\"
.\" The contents of this file are subject to the terms of the
.\" Common Development and Distribution License (the "License").
.\" You may not use this file except in compliance with the License.
.\"
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
.\" or http://www.opensolaris.org/os/licensing.
.\" See the License for the specific language governing permissions
.\" and limitations under the License.
.\"
.\" When distributing Covered Code, include this CDDL HEADER in each
.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
.\" If applicable, add the following below this CDDL HEADER, with the
.\" fields enclosed by brackets "[]" replaced with your own identifying
.\" information: Portions Copyright [yyyy] [name of copyright owner]
.\"
.\"
.\" Copyright (c) 2001, The IEEE and The Open Group.  All Rights Reserved.
.\" Portions Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
.\"
.TH STROPTS.H 3HEAD "Sep 10, 2004"
.SH NAME
stropts.h, stropts \- STREAMS interface (STREAMS)
.SH SYNOPSIS
.LP
.nf
#include <\fBstropts.h\fR>
.fi

.SH DESCRIPTION
.sp
.LP
The <\fBstropts.h\fR> header defines the \fBbandinfo\fR structure, which
includes the following members:
.sp
.in +2
.nf
unsigned char bi_pri     /* priority band */
int           bi_flag    /* flushing type */
.fi
.in -2

.sp
.LP
The <\fBstropts.h\fR> header defines the \fBstrpeek\fR structure that includes
the following members:
.sp
.in +2
.nf
struct strbuf ctlbuf     /* control portion of the message */
struct strbuf databuf    /* data portion of the message */
t_uscalar_t   flags      /* RS_HIPRI or 0 */
.fi
.in -2

.sp
.LP
The <\fBstropts.h\fR> header defines the \fBstrbuf\fR structure that includes
the following members:
.sp
.in +2
.nf
int  maxlen     /* maximum buffer length */
int  len        /* length of data */
char *buf       /* pointer to buffer */
.fi
.in -2

.sp
.LP
The <\fBstropts.h\fR> header defines the \fBstrfdinsert\fR structure that
includes the following members:
.sp
.in +2
.nf
struct strbuf ctlbuf     /* control portion of the message */
struct strbuf databuf    /* data portion of the message */
t_uscalar_t   flags      /* RS_HIPRI or 0 */
int           fildes     /* file descriptor of the other stream */
int           offset     /* relative location of the stored value */
.fi
.in -2

.sp
.LP
The <\fBstropts.h\fR> header defines the \fBstrioctl\fR structure that includes
the following members:
.sp
.in +2
.nf
int  ic_cmd        /* ioctl() command */
int  ic_timout     /* timeout for response */
int  ic_len        /* length of data */
char *ic_dp        /* pointer to buffer */
.fi
.in -2

.sp
.LP
The <\fBstropts.h\fR> header defines the \fBstrrecvfd\fR structure that
includes the following members:
.sp
.in +2
.nf
int   fda     /* received file descriptor */
uid_t uid     /* UID of sender */
gid_t gid     /* GID of sender */
.fi
.in -2

.sp
.LP
The \fBuid_t\fR and \fBgid_t\fR types are defined through \fBtypedef\fR as
described in <\fBsys/types.h\fR>. See \fBtypes.h\fR(3HEAD).
.sp
.LP
The <\fBstropts.h\fR> header defines the \fBt_scalar_t\fR and \fBt_uscalar_t\fR
types, respectively, as signed and unsigned opaque types of equal length of at
least 32 bits.
.sp
.LP
The <\fBstropts.h\fR> header defines the \fBstr_list\fR structure that includes
the following members:
.sp
.in +2
.nf
int              sl_nmods        /* number of STREAMS module names */
struct str_mlist *sl_modlist     /* STREAMS module names */
.fi
.in -2

.sp
.LP
The <\fBstropts.h\fR> header defines the \fBstr_mlist\fR structure that
includes the following member:
.sp
.ne 2
.na
\fB\fBchar l_name[FMNAMESZ+1]\fR\fR
.ad
.RS 27n
a STREAMS module name
.RE

.sp
.LP
The following macros are defined for use as the request argument to
\fBioctl()\fR:
.sp
.ne 2
.na
\fB\fBI_PUSH\fR\fR
.ad
.RS 15n
Push a STREAMS module.
.RE

.sp
.ne 2
.na
\fB\fBI_POP\fR\fR
.ad
.RS 15n
Pop a STREAMS module.
.RE

.sp
.ne 2
.na
\fB\fBI_LOOK\fR\fR
.ad
.RS 15n
Get the top module name.
.RE

.sp
.ne 2
.na
\fB\fBI_FLUSH\fR\fR
.ad
.RS 15n
Flush a stream.
.RE

.sp
.ne 2
.na
\fB\fBI_FLUSHBAND\fR\fR
.ad
.RS 15n
Flush one band of a stream.
.RE

.sp
.ne 2
.na
\fB\fBI_SETSIG\fR\fR
.ad
.RS 15n
Ask for notification signals.
.RE

.sp
.ne 2
.na
\fB\fBI_GETSIG\fR\fR
.ad
.RS 15n
Retrieve current notification signals.
.RE

.sp
.ne 2
.na
\fB\fBI_FIND\fR\fR
.ad
.RS 15n
Look for a STREAMS module.
.RE

.sp
.ne 2
.na
\fB\fBI_PEEK\fR\fR
.ad
.RS 15n
Peek at the top message on a stream.
.RE

.sp
.ne 2
.na
\fB\fBI_SRDOPT\fR\fR
.ad
.RS 15n
Set the read mode.
.RE

.sp
.ne 2
.na
\fB\fBI_GRDOPT\fR\fR
.ad
.RS 15n
Get the read mode.
.RE

.sp
.ne 2
.na
\fB\fBI_NREAD\fR\fR
.ad
.RS 15n
Size the top message.
.RE

.sp
.ne 2
.na
\fB\fBI_FDINSERT\fR\fR
.ad
.RS 15n
Send implementation-defined information about another stream.
.RE

.sp
.ne 2
.na
\fB\fBI_STR\fR\fR
.ad
.RS 15n
Send a STREAMS \fBioctl()\fR.
.RE

.sp
.ne 2
.na
\fB\fBI_SWROPT\fR\fR
.ad
.RS 15n
Set the write mode.
.RE

.sp
.ne 2
.na
\fB\fBI_GWROPT\fR\fR
.ad
.RS 15n
Get the write mode.
.RE

.sp
.ne 2
.na
\fB\fBI_SENDFD\fR\fR
.ad
.RS 15n
Pass a file descriptor through a STREAMS pipe.
.RE

.sp
.ne 2
.na
\fB\fBI_RECVFD\fR\fR
.ad
.RS 15n
Get a file descriptor sent via I_SENDFD.
.RE

.sp
.ne 2
.na
\fB\fBI_LIST\fR\fR
.ad
.RS 15n
Get all the module names on a stream.
.RE

.sp
.ne 2
.na
\fB\fBI_ATMARK\fR\fR
.ad
.RS 15n
Is the top message ``marked''?
.RE

.sp
.ne 2
.na
\fB\fBI_CKBAND\fR\fR
.ad
.RS 15n
See if any messages exist in a band.
.RE

.sp
.ne 2
.na
\fB\fBI_GETBAND\fR\fR
.ad
.RS 15n
Get the band of the top message on a stream.
.RE

.sp
.ne 2
.na
\fB\fBI_CANPUT\fR\fR
.ad
.RS 15n
Is a band writable?
.RE

.sp
.ne 2
.na
\fB\fBI_SETCLTIME\fR\fR
.ad
.RS 15n
Set close time delay.
.RE

.sp
.ne 2
.na
\fB\fBI_GETCLTIME\fR\fR
.ad
.RS 15n
Get close time delay.
.RE

.sp
.ne 2
.na
\fB\fBI_LINK\fR\fR
.ad
.RS 15n
Connect two streams.
.RE

.sp
.ne 2
.na
\fB\fBI_UNLINK\fR\fR
.ad
.RS 15n
Disconnect two streams.
.RE

.sp
.ne 2
.na
\fB\fBI_PLINK\fR\fR
.ad
.RS 15n
Persistently connect two streams.
.RE

.sp
.ne 2
.na
\fB\fBI_PUNLINK\fR\fR
.ad
.RS 15n
Dismantle a persistent STREAMS link.
.RE

.sp
.LP
The following macro is defined for use with \fBI_LOOK\fR:
.sp
.ne 2
.na
\fB\fBFMNAMESZ\fR\fR
.ad
.RS 12n
minimum size in bytes of the buffer referred to by the \fBarg\fR argument
.RE

.sp
.LP
The following macros are defined for use with \fBI_FLUSH\fR:
.sp
.ne 2
.na
\fB\fBFLUSHR\fR\fR
.ad
.RS 11n
flush read queues
.RE

.sp
.ne 2
.na
\fB\fBFLUSHW\fR\fR
.ad
.RS 11n
flush write queues
.RE

.sp
.ne 2
.na
\fB\fBFLUSHRW\fR\fR
.ad
.RS 11n
flush read and write queues
.RE

.sp
.LP
The following macros are defined for use with \fBI_SETSIG\fR:
.sp
.ne 2
.na
\fB\fBS_RDNORM\fR\fR
.ad
.RS 13n
A normal (priority band set to 0)  message has arrived at the head of a stream
head read queue.
.RE

.sp
.ne 2
.na
\fB\fBS_RDBAND\fR\fR
.ad
.RS 13n
A message with a non-zero priority band has arrived at the head of a stream
head read queue.
.RE

.sp
.ne 2
.na
\fB\fBS_INPUT\fR\fR
.ad
.RS 13n
A message, other than a high-priority message, has arrived at the head of a
stream head read queue.
.RE

.sp
.ne 2
.na
\fB\fBS_HIPRI\fR\fR
.ad
.RS 13n
A high-priority message is present on a stream head read queue.
.RE

.sp
.ne 2
.na
\fB\fBS_OUTPUT\fR\fR
.ad
.RS 13n
The write queue for normal data (priority band 0) just below the stream head is
no longer full. This notifies the process that there is room on the queue for
sending (or writing) normal data downstream.
.RE

.sp
.ne 2
.na
\fB\fBS_WRNORM\fR\fR
.ad
.RS 13n
Equivalent to \fBS_OUTPUT\fR.
.RE

.sp
.ne 2
.na
\fB\fBS_WRBAND\fR\fR
.ad
.RS 13n
The write queue for a non-zero priority band just below the stream head is no
longer full.
.RE

.sp
.ne 2
.na
\fB\fBS_MSG\fR\fR
.ad
.RS 13n
A STREAMS signal message that contains the \fBSIGPOLL\fR signal reaches the
front of the stream head read queue.
.RE

.sp
.ne 2
.na
\fB\fBS_ERROR\fR\fR
.ad
.RS 13n
Notification of an error condition reaches the stream head.
.RE

.sp
.ne 2
.na
\fB\fBS_HANGUP\fR\fR
.ad
.RS 13n
Notification of a hangup reaches the stream head.
.RE

.sp
.ne 2
.na
\fB\fBS_BANDURG\fR\fR
.ad
.RS 13n
When used in conjunction with \fBS_RDBAND\fR, \fBSIGURG\fR is generated instead
of \fBSIGPOLL\fR when a priority  message reaches the front of the stream head
read queue.
.RE

.sp
.LP
The following macro is defined for use with \fBI_PEEK\fR:
.sp
.ne 2
.na
\fB\fBRS_HIPRI\fR\fR
.ad
.RS 12n
Only look for high-priority messages.
.RE

.sp
.LP
The following macros are defined for use with \fBI_SRDOPT\fR:
.sp
.ne 2
.na
\fB\fBRNORM\fR\fR
.ad
.RS 13n
Byte-stream mode, the default.
.RE

.sp
.ne 2
.na
\fB\fBRMSGD\fR\fR
.ad
.RS 13n
Message-discard mode.
.RE

.sp
.ne 2
.na
\fB\fBRMSGN\fR\fR
.ad
.RS 13n
Message-non-discard mode.
.RE

.sp
.ne 2
.na
\fB\fBRPROTNORM\fR\fR
.ad
.RS 13n
Fail \fBread()\fR with \fB[EBADMSG]\fR if a message containing a control part
is at the front of the stream head read queue.
.RE

.sp
.ne 2
.na
\fB\fBRPROTDAT\fR\fR
.ad
.RS 13n
Deliver the control part of a message as data when a process issues a
\fBread()\fR
.RE

.sp
.ne 2
.na
\fB\fBRPROTDIS\fR\fR
.ad
.RS 13n
Discard the control part of a message, delivering any data part, when a process
issues a \fBread()\fR
.RE

.sp
.LP
The following macro is defined for use with \fBI_SWOPT\fR:
.sp
.ne 2
.na
\fB\fBSNDZERO\fR\fR
.ad
.RS 11n
Send a zero-length message downstream when a \fBwrite()\fR of 0 bytes occurs.
.RE

.sp
.LP
The following macros are defined for use with \fBI_ATMARK\fR:
.sp
.ne 2
.na
\fB\fBANYMARK\fR\fR
.ad
.RS 12n
Check if the message is marked.
.RE

.sp
.ne 2
.na
\fB\fBLASTMARK\fR\fR
.ad
.RS 12n
Check if the message is the last one marked on the queue.
.RE

.sp
.LP
The following macro is defined for use with \fBI_UNLINK\fR:
.sp
.ne 2
.na
\fB\fBMUXID_ALL\fR\fR
.ad
.RS 13n
Unlink all stream linked to the stream associated with \fBfildes\fR.
.RE

.sp
.LP
The following macros are defined for \fBgetmsg()\fR, \fBgetpmsg()\fR,
\fBputmsg()\fR, and \fBputpmsg()\fR:
.sp
.ne 2
.na
\fB\fBMSG_ANY\fR\fR
.ad
.RS 13n
Receive any message.
.RE

.sp
.ne 2
.na
\fB\fBMSG_BAND\fR\fR
.ad
.RS 13n
Receive message from specified band.
.RE

.sp
.ne 2
.na
\fB\fBMSG_HIPRI\fR\fR
.ad
.RS 13n
Send/receive high-priority message.
.RE

.sp
.ne 2
.na
\fB\fBMORECTL\fR\fR
.ad
.RS 13n
More control information is left in message.
.RE

.sp
.ne 2
.na
\fB\fBMOREDATA\fR\fR
.ad
.RS 13n
More data is left in message.
.RE

.sp
.LP
The <\fBstropts.h\fR> header can make visible all of the symbols from
<\fBunistd.h\fR>.
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Standard
.TE

.SH SEE ALSO
.sp
.LP
.BR close (2),
.BR fcntl (2),
.BR getmsg (2),
.BR ioctl (2),
.BR open (2),
.BR pipe (2),
.BR poll (2),
.BR putmsg (2),
.BR read (2),
.BR write (2),
.BR signal (3C),
.BR types.h (3HEAD),
.BR unistd.h (3HEAD),
.BR attributes (7),
.BR standards (7)
